
#if Windows

#include <Windows.h>

#elif Android
#include <UndefCSharpKeywords.h>
#include <jni.h>
#include <time.h>
#endif

#include "Environment.h"

using namespace Riccsson::System;
using namespace Riccsson::System::Collections;

PROP3GET_STATIC_INIT(Environment, GC_PTR<string>, CommandLine)
PROP3_STATIC_INIT(Environment, GC_PTR<string>, CurrentDirectory)
PROP3GET_STATIC_INIT(Environment, int, CurrentManagedThreadId)
PROP3_STATIC_INIT(Environment, int, ExitCode)
PROP3GET_STATIC_INIT(Environment, bool, HasShutdownStarted)
PROP3GET_STATIC_INIT(Environment, bool, Is64BitOperatingSystem)
PROP3GET_STATIC_INIT(Environment, bool, Is64BitProcess)
PROP3GET_STATIC_INIT(Environment, GC_PTR<string>, MachineName)
PROP3GET_STATIC_INIT(Environment, GC_PTR<string>, NewLine)
PROP3GET_STATIC_INIT(Environment, GC_PTR<OperatingSystem>, OSVersion)
PROP3GET_STATIC_INIT(Environment, int, ProcessorCount)
PROP3GET_STATIC_INIT(Environment, GC_PTR<string>, StackTrace)
PROP3GET_STATIC_INIT(Environment, GC_PTR<string>, SystemDirectory)
PROP3GET_STATIC_INIT(Environment, int, TickCount)


PROP3_GET_CPP(Environment, GC_PTR<string>, CommandLine)
{
	throw;
}
PROP3_GET_CPP(Environment, GC_PTR<string>, CurrentDirectory)
{
	throw;
}
PROP3_SET_CPP(Environment, GC_PTR<string>, CurrentDirectory)
{
	throw;
}
PROP3_GET_CPP(Environment, int, CurrentManagedThreadId)
{
	throw;
}
PROP3_GET_CPP(Environment, int, ExitCode)
{
	throw;
}
PROP3_SET_CPP(Environment, int, ExitCode)
{
	throw;
}
PROP3_GET_CPP(Environment, bool, HasShutdownStarted)
{
	throw;
}
PROP3_GET_CPP(Environment, bool, Is64BitOperatingSystem)
{
	throw;
}
PROP3_GET_CPP(Environment, bool, Is64BitProcess)
{
	throw;
}
PROP3_GET_CPP(Environment, GC_PTR<string>, MachineName)
{
	throw;
}
PROP3_GET_CPP(Environment, GC_PTR<string>, NewLine)
{
	throw;
}
PROP3_GET_CPP(Environment, GC_PTR<OperatingSystem>, OSVersion)
{
	throw;
}
PROP3_GET_CPP(Environment, int, ProcessorCount)
{
	throw;
}
PROP3_GET_CPP(Environment, GC_PTR<string>, StackTrace)
{
	throw;
}
PROP3_GET_CPP(Environment, GC_PTR<string>, SystemDirectory)
{
	throw;
}
PROP3_GET_CPP(Environment, int, SystemPageSize)
{
	throw;
}
PROP3_GET_CPP(Environment, int, TickCount)
{
#if Windows
	// Get ticks in milliseconds since system startup.
	// http://msdn.microsoft.com/en-us/library/windows/desktop/ms724408(v=vs.85).aspx
	int ticksSinceSystemStartup = (int)GetTickCount();
	return ticksSinceSystemStartup;
#elif Android
	// I don't really know what time this will give...
	struct timeval tv;
    gettimeofday(&tv, NULL);
    int ticksSinceSystemStartup = ((tv.tv_sec * 1000) + (tv.tv_usec / 1000));
	return ticksSinceSystemStartup;
#else
	throw;
#endif
}
PROP3_GET_CPP(Environment, GC_PTR<string>, UserDomainName)
{
	throw;
}
PROP3_GET_CPP(Environment, bool, UserInteractive)
{
	throw;
}
PROP3_GET_CPP(Environment, GC_PTR<string>, UserName)
{
	throw;
}
PROP3_GET_CPP(Environment, GC_PTR<Version>, version)
{
	throw;
}
PROP3_GET_CPP(Environment, long, WorkingSet)
{
	throw;
}
void Environment::Exit(int exitCode)
{
	throw;
}
GC_PTR<string> Environment::ExpandEnvironmentVariables(string* name)
{
	throw;
}
void Environment::FailFast(string* message)
{
	throw;
}
void Environment::FailFast(string* message, Exception* exception)
{
	throw;
}
GC_PTR<Array<string>> Environment::GetCommandLineArgs()
{
	throw;
}
GC_PTR<string> Environment::GetEnvironmentVariable(string* variable)
{
	throw;
}
GC_PTR<string> Environment::GetEnvironmentVariable(string* variable, EnvironmentVariableTarget target)
{
	throw;
}
GC_PTR<IDictionary> Environment::GetEnvironmentVariables()
{
	throw;
}
GC_PTR<IDictionary> Environment::GetEnvironmentVariables(EnvironmentVariableTarget target)
{
	throw;
}
GC_PTR<string> Environment::GetFolderPath(Environment::SpecialFolder folder)
{
	throw;
}
GC_PTR<string> Environment::GetFolderPath(Environment::SpecialFolder folder, Environment::SpecialFolderOption option)
{
	throw;
}
GC_PTR<Array<string>> Environment::GetLogicalDrives()
{
	throw;
}
void Environment::SetEnvironmentVariable(string* variable, GC_PTR<string> value)
{
	throw;
}
void Environment::SetEnvironmentVariable(string* variable, GC_PTR<string> value, EnvironmentVariableTarget target)
{
	throw;
}